home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / programm / GNU_C++ / LIB / CFLIB-11.LZH / src / nkcc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-19  |  811 b   |  40 lines

  1. #include "intern.h"
  2.  
  3. unsigned short gem_to_norm(int ks, int kr)
  4. {
  5.     unsigned short    knorm;
  6.  
  7.     knorm = nkc_tos2n(((long)(kr & 0xff) |                         /* ascii Bits 0-7 */
  8.                             (((long)kr & 0x0000ff00L) << 8L) |         /* scan Bits 16-23 */
  9.                             ((long)(ks & 0xff) << 24L)));                /* kstate Bits 24-31 */
  10.     return knorm;
  11. }
  12.  
  13. void norm_to_gem(unsigned int norm, int *ks, int *kr)
  14. {
  15.     long    toskey;
  16.     
  17.     toskey = nkc_n2tos(norm);
  18.     *kr = ((int)(toskey & 0x000000ffL) |                        /* ascii */
  19.              (int)((toskey & 0x00ff0000L) >> 8L));                /* scan */
  20.     *ks = (int)((toskey & 0xff000000L) >> 24L);                /* kstate */
  21. }
  22.  
  23. void str_tolower(char *str)
  24. {
  25.     while (*str != EOS)
  26.     {
  27.         *str = nkc_tolower(*str);
  28.         str++;
  29.     }
  30. }
  31.  
  32. void str_toupper(char *str)
  33. {
  34.     while (*str != EOS)
  35.     {
  36.         *str = nkc_toupper(*str);
  37.         str++;
  38.     }
  39. }
  40.